import { useParams } from 'react-router-dom';

import VulnerableTemplate from '@/components/VulnerableTemplate';

import XssDom from './level/XssDom';
import XssHref from './level/xssHref';
import XssReflect from './level/XssReflect';
import XssStore from './level/XssStore';

const Xss = () => {
  const { level } = useParams();
  const levelMap: any = {
    reflect: XssReflect,
    dom: XssDom,
    href: XssHref,
    store: XssStore,
  };

  return <VulnerableTemplate {...levelMap[level!]} />;
};

export default Xss;
